import request from "@/axios/request";
import url from "@/axios/url";
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesMaterialRequisitionDetail/export`;
// 获取子表详情
export function getInfo (id = "") {
  return request({
    url: `${mesUrl}mesMaterialRequisitionDetail/info/${id}`,
    method: "get",
  });
}
// 获取主表详情
export function getMasterInfo (id = "") {
  return request({
    url: `${mesUrl}mesMaterialRequisition/info/${id}`,
    method: "get",
  });
}
//分页查询
export function getList (params = {}) {
  return request({
    url: `${mesUrl}mesMaterialRequisitionDetail/selectList`,
    method: "get",
    params,
  });
}
//新增
export function rowCreate (data = {}) {
  return request({
    url: `${mesUrl}mesMaterialRequisitionDetail`,
    method: "post",
    data,
  });
}
//修改
export function rowUpdate (data = {}) {
  return request({
    url: `${mesUrl}mesMaterialRequisitionDetail`,
    method: "put",
    data,
  });
}
//删除
export function rowDel (id) {
  return request({
    url: `${mesUrl}mesMaterialRequisitionDetail/${id}`,
    method: "put",
  });
}
//下拉框字典等
// 查询单据类型 10领料出库11委外领料出库20采购退货出库30销售出库40其它出库50返修出库60报废出库70补料出库列表
export function getOrderTypeList () {
  return request({
    url: `${adminUrl}dict/type/wms_out_order_type`,
    method: "get",
  });
}
